package com.example.springboot.util;

import java.awt.*;
import java.awt.event.KeyEvent;

/**
 * @auther: Wyz
 * @date: 2023/3/27 18:01
 * @return
 */
public class Aaa {

    public Aaa(){
        for (int i = 0; i < 2000; i++) {

            Robot robot = getRobot();
            assert robot != null;
            robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK);//按下鼠标左键
            robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK);//释放鼠标左键
            robot.delay(10);

        }
    }

    public static void main(String[] args){
        new Aaa();
    }

    private static Robot getRobot(){
        // 创建Robot对象
        Robot robot = null;
        try {
            robot = new Robot();
        } catch (AWTException e) {
            e.printStackTrace();
        }
        return robot;
    }
}
